﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Threading;
using System.Globalization;
using Nivdal.AuxCode;

namespace Nivdal
{
    public partial class PlayerTransfers : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            //if (!HttpContext.Current.User.Identity.IsAuthenticated)
            //    Response.Redirect("Default.aspx");
            GetNivdalData.GetNivdalData GND = new GetNivdalData.GetNivdalData();
            OnlineUser ou = (OnlineUser)Session["User"];
            //if (ou.TeamId == "Null")
            //    Response.Redirect("~/GeneralMessage.aspx?MessageString=M74ggdizz5wfeh");

            string PlayerId;

            if (Request.QueryString["PlayerId"] != null)
            {
                PlayerId = Request.QueryString["PlayerId"].ToString();
                this.SqlDataSource1.SelectParameters.Add("PlayerId", PlayerId);
                this.SqlDataSource1.SelectParameters.Add("Language", ou.Language);
                this.PlayerLinkButton.NavigateUrl = "~/Player.aspx?Id=" + PlayerId;

                PlayerLinkButton.Text = GND.ReadNivdalStringData("@PlayerId", "Nivdal_GetPlayerNameByIdProc", PlayerId);
                this.Title = Resources.Resource.Default_PageTitle + ", " + Resources.Resource.Player_LinkButton2 + ": " + PlayerLinkButton.Text;
                //this.Title = PlayerLinkButton.Text + " " + Resources.Resource.Player_LinkButton2 + " - nivdal.com!";
            }
            else
                Response.Redirect("GeneralMessage.aspx?MessageString=Q4OFsdwsTHJA");
        }

        protected override void InitializeCulture()
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(ou.UICulture);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(ou.Culture);
        }
    }
}